<template>
  <div>
    <!-- <BreakSpace label="维修项目列表" :containerStyle="{ marginBottom: '10px' }" /> -->
    <FilterTable
      ref="table"
      :columns="columns"
      :params="fetchParams"
      :dataSource="dataList"
      :datakey="'records'"
      :fetchapi="fetchApi"
      :onColumnsChange="(columns) => (this.columns = columns)"
      :onRowSelectChange="selectChange"
      selectionType="single"
      :isSelectColumn="false"
      height="auto"
    >
    </FilterTable>
  </div>
</template>
<script>
import { queryClaimVisit }  from '@/api/dictionary/index';
export default {
  props: ['claimNo'],
  components: {},
  data() {
    return {
      dataList: [],
      allUser: [],
      dataList1: [],
      chargePartition: [],
      visible: false,
      visibleDrawer: false,
      action: { type: 'add', visible: false, title: '回访单', data: {}  },
      collapse: false,
      infoId: null,
      // topFilterInit: this.topFilterInitFun(),
      flterValue: {}, //参数
      columns: this.creatHeader(),
      fetchApi: queryClaimVisit,
      fetchParams: {
        claimNo: this.claimNo,
      }, //ipa 接口

      selectedRows: [], //选中经销商
      saveData: null,
      activeName: '',
      menus: [],
    };
  },
  created() {

  },
  methods: {
    closeHandler(val, type) {
      this.action.visible = false;
      if (type === 'refresh') {
        // 重新加载
        this.fetchParams = { ...this.fetchParams };
      }
    },

    formChangeHandle(val) {
      console.log(val);
      this.saveData = val;
    },
    //搜索获取数据
    changeHandle(val) {
      this.fetchParams = Object.assign({}, this.fetchParams, val);
      console.log(val);
    },
    //选中
    selectChange(rows) {
      this.selectedRows = rows;
      console.log(this.selectedRows);
    },
    //取消操作
    closeDialog() {
      this.$emit('close', { visible: false, data: this.selectedRows, type: 'close' });
    },
    chooseOrderNo() {
      this.visible = true;
    },
    add() {},

    //table表头和数据源
    creatHeader() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: (props) => {
            return <span>{props.row.index + 1}</span>;
          },
        },
        { title: '回访状态', dataIndex: 'visitState', sorter: true },
        { title: '回访人', dataIndex: 'ccName', sorter: true },
        { title: '回访内容', dataIndex: 'visitContext', sorter: true },
        { title: '回访时间',dataIndex: 'visitTime', sorter: true ,dateFormat: 'yyyy-MM-dd HH:mm:ss'},
        { title: '备注', dataIndex: 'remark', sorter: true },
      ];
    },
  },
};
</script>

<style lang="less" scoped></style>
